package study2018.com.xtianzhuang.www.properties;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class ReadProperty {
	private static final String path = "/study.properties";
	private static String name = new String();
	private static String id = new String();
	static {
		InputStream is = ReadProperty.class.getResourceAsStream(path);
		Properties dbProps = new Properties();
		try {
			dbProps.load(is);
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			try {
				is.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		name = dbProps.getProperty("name");
		System.out.println(name);
		id = dbProps.getProperty("id");
		System.out.println(id);
	}

	public static void main(String[] args) {

	}
}
